<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="<s:url value="/js/irb.js"/>"></script>

<s:url var="selectUrl" action="getCommittees" namespace="/Directories/IrbSops"/>

<s:form cssClass="tableEdit2" id="formEdit" >

    <tr>
        <th colspan="2" class="tableTitle">
            <h5>Ethics Committee SOPs</h5>
        </th>
    </tr>

<table class="tableEditFixedSeparacion">
    <col width="140px" />
    <col width="190px" />
    <s:hidden name="irb.id" id="irbId" value="%{irb.id}" />
    <s:select label="Committee" name="irb.comiteEtica.id" id="comite" value="%{irb.comiteEtica.id}"
              headerKey="" headerValue="Choose Committee"
              list="comites"
              listKey="id"
              listValue="name"/>

    <s:select label="Investigator Brochure" name="irb.investigatorBrochure" value="%{irb.investigatorBrochure}"
              cssClass="requiredTimeline"
              id="investigatorBrochure"
              headerKey="" headerValue="Required timelines for submission"
              onclick="requiredTimelineCheck()"
              list="requiredTimelineList"/>
    <s:textfield label="Specify" id="investigatorBrochureSpecify" name="irb.investigatorBrochureSpecify"
              value="%{irb.investigatorBrochureSpecify}"/>
    <tr>
        <td><label>Comment:</label><img class="imgInfo" src="<s:url value="/images/info.png"/>"/></td>
        <td><s:textarea theme="simple" name="irb.investigatorBrochureComments" value="%{irb.investigatorBrochureComments}"/></td>
    </tr>

    <s:select label="SUSAR" name="irb.susar" value="%{irb.susar}"
              cssClass="requiredTimeline"
              id="susar"
              headerKey="" headerValue="Required timelines for submission"
              onclick="requiredTimelineCheck()"
              list="requiredTimelineList"/>
    <s:textfield label="Specify" id="susarSpecify" name="irb.susarSpecify"
                 value="%{irb.susarSpecify}"/>
    <tr>
        <td><label>Comment:</label><img class="imgInfo2" src="<s:url value="/images/info.png"/>"/></td>
        <td><s:textarea theme="simple" name="irb.susarComments" value="%{irb.susarComments}"/></td>
    </tr>

    <s:select label="SAEs" name="irb.saes" value="%{irb.saes}"
              cssClass="requiredTimeline"
              id="saes"
              headerKey="" headerValue="Required timelines for submission"
              onclick="requiredTimelineCheck()"
              list="requiredTimelineList"/>
    <s:textfield label="Specify" id="saesSpecify" name="irb.saesSpecify"
                 value="%{irb.saesSpecify}"/>
    <tr>
        <td><label>Comment:</label><img class="imgInfo3" src="<s:url value="/images/info.png"/>"/></td>
        <td><s:textarea theme="simple" name="irb.saesComments" value="%{irb.saesComments}"/></td>
    </tr>

    <s:select label="Blinded?" name="irb.blinded" id="blinded"  value="%{irb.blinded}"
              list="yesNo"/>

    <s:select label="Periodic Reports" name="irb.periodicReports" value="%{irb.periodicReports}"
              id="periodicReports"
              headerKey="" headerValue="Frequency"
              list="frequencies"/>

    <s:select label="Significant Deviations" name="irb.significantDeviations" value="%{irb.significantDeviations}"
              cssClass="requiredTimeline"
              id="significantDeviations"
              headerKey="" headerValue="Required timelines for submission"
              onclick="requiredTimelineCheck()"
              list="requiredTimelineList"/>
    <s:textfield label="Specify" id="significantDeviationsSpecify" name="irb.significantDeviationsSpecify"
                 value="%{irb.significantDeviationsSpecify}"/>
    <tr>
        <td><label>Comment:</label><img class="imgInfo4" src="<s:url value="/images/info.png"/>"/></td>
        <td><s:textarea theme="simple" name="irb.significantDeviationsComments" value="%{irb.significantDeviationsComments}"/></td>
    </tr>

    <s:select label="Non Significant Deviations" name="irb.nonSignificantDeviations" value="%{irb.nonSignificantDeviations}"
              cssClass="requiredTimeline"
              id="nonSignificantDeviations"
              headerKey="" headerValue="Required timelines for submission"
              onclick="requiredTimelineCheck()"
              list="requiredTimelineList"/>
    <s:textfield label="Specify" id="nonSignificantDeviationsSpecify" name="irb.nonSignificantDeviationsSpecify"
                 value="%{irb.nonSignificantDeviationsSpecify}"/>
    <tr>
        <td><label>Comment:</label><img class="imgInfo5" src="<s:url value="/images/info.png"/>"/></td>
        <td><s:textarea theme="simple" name="irb.nonSignificantDeviationsComments" value="%{irb.nonSignificantDeviationsComments}"/></td>
    </tr>

    <s:select label="Reapproval required?" name="irb.reapprovalRequired" id="reapprovalRequired"
              value="%{irb.reapprovalRequired}"
              list="yesNo"/>

    <s:select label="Safety Documents Language" name="irb.safetyDocumentsLanguage" value="%{irb.safetyDocumentsLanguage}"
              id="safetyDocumentsLanguage"
              headerKey="" headerValue="Language"
              list="languages"/>

    <s:textarea label="General Comments" rows="3" name="irb.generalComments" id="generalComments" value="%{irb.generalComments}"/>

    <tr>
        <td colspan="2" class="centeredButtons">
            <s:submit value="Save" id="save" action="save" onclick="validate();$('#comite').removeAttr('disabled');" theme="simple" />
            <s:submit value="Clear" id="clear" theme="simple" onclick="clearForm(); changeComites('%{selectUrl}'); return false;" />
        </td>
    </tr>
   </table>
</s:form>

<div id="div_">If "Not specified" was selected please detail the agreed timeline and with whom it was agreed"</div>

<script type="text/javascript">
    $('#irb').css({"color":"#EE5102","fontWeight":"bold"});
    requiredTimelineCheck();
    showMoreInfo($("#div_"), "imgInfo");
    showMoreInfo($("#div_"), "imgInfo2");
    showMoreInfo($("#div_"), "imgInfo3");
    showMoreInfo($("#div_"), "imgInfo4");
    showMoreInfo($("#div_"), "imgInfo5");
</script>
<s:if test="irb.id != null">
    <script type="text/javascript">
        $('#comite').attr('disabled', 'disabled');
    </script>
</s:if>